<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<html>
<head>
<script type="text/javascript">
$(document).ready(function () {
   
    
})//end ready


function saveMenu() {
	//$('#user-fm').birthday 编辑日期表单值，然后提交
    $('#menu-fm').form('submit', {
        url: 'rest/menuUpdate.do',        
        onSubmit: function () {
            return $(this).form('validate');
        },
        success: function (result) {
            result = eval('(' + result + ')');
            if (result.success=='true') {
            	back('menu/index.do');
            } else {
                $.messager.show({
                    title: 'Error',
                    msg: result.msg
                });
            }
        }
    });
}

function back(url){
	$.get(url, {}, function(data){
		$("#center").empty();
        $("#center").html(data);
        $.parser.parse($("#center"));
    });
}


</script>
</head>
<body>
<div class="linkbar"><a>系统</a>/<a>菜单管理</a>/<a>编辑菜单</a></div>
		<!-- <div class="breadcrumb">系统 &gt;&gt;菜单管理&gt;&gt; 编辑菜单</div> -->
		<div id="menu-add" 	buttons="#menu-add-buttons">
			<form id="menu-fm" method="post" novalidate>
				<input type="hidden" name="id" value="${menu.id} "/>
				<input type="hidden" name="pid" value="${menu.pid} "/>
				<div class="fitem">
					<label><font color="red">*</font>菜单名称：</label> 
					<input name="menuname"  class="easyui-validatebox" required="true" validType="length[2,20]" 
				       missingMessage="该输入项不能为空，请确认！" invalidMessage="输入范围2到20个字符，请确认！"   value="${menu.menuname }"/>
				</div>
				<div class="fitem">
					<label>菜单备注：</label> <input name="menudesc"	class="easyui-validatebox" value="${menu.menudesc }">
				</div>
				<div class="fitem">
					<label><font color="red">*</font>菜单链接：</label> <input name="menucode" class="easyui-validatebox" required="true" validType="length[2,200]" 
				       missingMessage="该输入项不能为空，请确认！" invalidMessage="输入范围2到200个字符，请确认！" value="${menu.menucode }">
				</div>	
			</form>
		</div>
		<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveMenu()">保存</a> 
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="back('menu/index.do')">返回</a>
		</div>
		

</body>
</html>